package com.yanqu.road.entity.grandchild;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.DataStatus;

import java.util.ArrayList;
import java.util.List;

@FieldTypeAnnotation(tableName = "t_u_grand_child_exam")
public class GrandChildUserExam extends DataObject {

    @FieldTypeAnnotation(desc = "玩家ID", update = true, select = true)
    private long userId;
    @FieldTypeAnnotation(desc = "未处理科举结果")
    private List<GrandChildExamResult> resultList = new ArrayList<>();
    @FieldTypeAnnotation(desc = "未读科举编号")
    private String noReadNo = "";

    public GrandChildUserExam() {
    }

    public GrandChildUserExam(long userId, List<GrandChildExamResult> resultList, String noReadNo) {
        this.userId = userId;
        this.resultList = resultList;
        this.noReadNo = noReadNo;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        if (this.userId != userId) {
            this.userId = userId;
            setOp(DataStatus.Update);
        }
    }

    public List<GrandChildExamResult> getResultList() {
        return resultList;
    }

    public void setResultList(List<GrandChildExamResult> resultList) {
        if (null == resultList) {
            return;
        }
        this.resultList = resultList;
        setOp(DataStatus.Update);
    }

    public String getNoReadNo() {
        return noReadNo;
    }

    public void setNoReadNo(String noReadNo) {
        if (noReadNo == null) {
            return;
        }
        if (this.noReadNo == null || !this.noReadNo.equals(noReadNo)) {
            this.noReadNo = noReadNo;
            setOp(DataStatus.Update);
        }
    }
}
